#CFLAGS= -Wall 
CFLAGS= -g -Wall -L.
CXXFLAGS= -g -Wall -L.
LIBS= -lz -lcairo -ltinyxml -lswfstream

CXX=g++
CC=gcc
AR=ar

SRC_H=AbcFile.h          DefineBitsLossless.h  FileAttributes.h  Matrix.h         NameSpace.h     Rect.h                ShowFrame.h          SwfStream.h\
Bits.h             DefineEditText.h      FillStyleArray.h  Metadata.h       NamespaceSet.h  RGBA.h                StringInfo.h         Tag.h\
BitStream.h        DefineFont2.h         FillStyle.h       MetadataInfo.h   OptionDetail.h  RGB.h                 StyleChangeRecord.h  TagHeader.h\
ClassInfo.h        DefineShape3.h        GlyphEntry.h      MethodBody.h     OptionInfo.h    ScriptInfo.h          SwfFile.h            TextRecord.h\
Color.h            DefineShape.h         Instance.h        MethodInfo.h     PlaceObject2.h  SetBackgroundColor.h  swf.h                Trait.h\
ConstantPool.h     DefineText2.h         ItemInfo.h        Multiname.h      PlayListTag.h   Shape.h               SWFHeader.h          type.h\
CSMTextSettings.h  DoABC.h               LineStyleArray.h  MultinameInfo.h  Point.h         ShapeRecord.h         SWFInputStream.h\
Defination.h       ExceptionInfo.h       LineStyle.h       MultinameL.h     QName.h         ShapeWithStyle.h      SwfObject.h

SRC_CXX=AbcFile.cpp             DefineFont2.cpp     Instance.cpp      Multiname.cpp      PlaceObject2.cpp        shape.cpp            SwfObject.cpp\
Bits.cpp                DefineShape3.cpp    ItemInfo.cpp      MultinameInfo.cpp  QName.cpp               ShapeRecord.cpp      SwfStream.cpp\
BitStream.cpp           DefineShape.cpp     Matrix.cpp        MultinameL.cpp     Rect.cpp                StringInfo.cpp       Tag.cpp\
ClassInfo.cpp           DefineText2.cpp     Metadata.cpp      NameSpace.cpp      RGBA.cpp                StringInfo_test.cpp  TagHeader.cpp\
ConstantPool.cpp        DoABC.cpp           MetadataInfo.cpp  NamespaceSet.cpp   RGB.cpp                 SwfFile.cpp          \
DefineBitsLossless.cpp  ExceptionInfo.cpp   MethodBody.cpp    OptionDetail.cpp   ScriptInfo.cpp          SWFHeader.cpp        TextRecord.cpp\
DefineEditText.cpp      FileAttributes.cpp  MethodInfo.cpp    OptionInfo.cpp     SetBackgroundColor.cpp  SWFInputStream.cpp   Trait.cpp

SRC_C=

OBJ=$(SRC_CXX:.cpp=.o) $(SRC_C:.c=.o)

LIBNAME=libswfstream.a
TESTNAME=test

.PHONY:all clean
all:
	make make
	make -j $(TESTNAME)
$(LIBNAME):$(OBJ)
	$(AR) cq $(LIBNAME) $(OBJ)
doc:
	doxygen
clean:
	rm files.sub
	touch files.sub
	rm $(OBJ) $(LIBNAME) $(TESTNAME)
$(TESTNAME):test.cpp $(LIBNAME)
	$(CXX) $(CXXFLAGS) -o $(TESTNAME) test.cpp $(LIBS)
make:
#	$(CC) $(CFLAGS) -MM $(SRC_C) >files.tmp
	$(CXX) $(CXXFLAGS) -MM test.cpp $(SRC_H) $(SRC_CXX) >files.tmp
	mv files.tmp files.sub
include files.sub

